<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div style="height: 2000px;"></div>
</body>
<script src="./节流.js"></script>
<script>
    //节流：控制高频事件的执行次数 让它在规定的秒数中 只执行一次

    window.onscroll = throttle(function() {
        console.log('你好啊我是节流');
    }, 500)
</script>

</html>